#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from dragon.selector import Selector
from dragon.page import DraPage

class PlateSe:
    searchInput=Selector('input.search-input.f1','搜索框')
    selectedPlateType=Selector('span.plate-parent-name.active.cp','选中的板块按钮')
    plateTypeButton=Selector('div.plate-header>div>span','板块分类按钮')
    conceptButton=Selector('text=概念板块','概念板块按钮')
    industryButton=Selector('text=行业板块','行业板块按钮')

    selectedSort=Selector('button.sort-bottom-btn.hlight','选中的排序按钮')
    sortButton=Selector('div.sort-button.df.aic>button','排序按钮')
    changeSort=Selector('text=异动','异动排序按钮')
    ratioSort=Selector('text=比值','比值排序按钮')
    limitUpSort=Selector('text=涨停','涨停排序按钮')

    allPlate=Selector('div.plate-items-item>span:nth-child(1)','全部板块')
    plateList=Selector('div.plate_list.f1.oys','板块列表')
    plateBlock=Selector('li.plate-item','板块')
    selectedPlateName = Selector('.plate-item__active>.pl30', '选中的板块名称')
    plateName=Selector('li.plate-item>span:nth-child(1)','板块名称')
    changeCount=Selector('li.plate-item>span:nth-child(2)','异动数量')
    limitUpCount=Selector('li.plate-item>span:nth-child(3)','涨停数量')
    
class PlatePage:
    def __init__(self, draPage: DraPage):
        self.draPage = draPage
        self.searchInput = draPage.locator(PlateSe.searchInput)
        self.selectedPlateType = draPage.locator(PlateSe.selectedPlateType)
        self.plateTypeButton = draPage.locator(PlateSe.plateTypeButton)
        self.conceptButton = draPage.locator(PlateSe.conceptButton)
        self.industryButton = draPage.locator(PlateSe.industryButton)
        self.selectedSort = draPage.locator(PlateSe.selectedSort)
        self.sortButton = draPage.locator(PlateSe.sortButton)
        self.changeSort = draPage.locator(PlateSe.changeSort)
        self.ratioSort = draPage.locator(PlateSe.ratioSort)
        self.limitUpSort = draPage.locator(PlateSe.limitUpSort)
        self.allPlate = draPage.locator(PlateSe.allPlate)
        self.plateList = draPage.locator(PlateSe.plateList)
        self.plateBlock = draPage.locator(PlateSe.plateBlock)
        self.selectedPlateName = draPage.locator(PlateSe.selectedPlateName)
        self.plateName = draPage.locator(PlateSe.plateName)
        self.changeCount = draPage.locator(PlateSe.changeCount)
        self.limitUpCount = draPage.locator(PlateSe.limitUpCount)






